<style>
	.setimg{
		margin:-2px 5px 0 0
	}
	#addform .file{
		position: relative;
	}
	#addform .file span{
		position: absolute;
		right: 80px;
		top: 15px;
		background-color: #414959;
		padding: 2px 6px;
		height: 23px;
		line-height: 23px;
		cursor: pointer;
		color: #fff;
		font-size: 14px;
		overflow: hidden;
		background-image: linear-gradient(to bottom, #6c7994, #414959);
		border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
		border: 1px solid #363d4a;
		display: inline-block;
		*display: inline;
		*zoom: 1;
	}
	#addform .file span input{
		position: absolute;
		font-size: 100px;
		left: 0;
		top: 0;
		opacity: 0;
		filter: alpha(opacity=0);
		cursor: pointer;
	}
</style>
<div class="row-fluid">
	<a style="border:1px solid #ccc" class="block-heading" data-toggle="collapse">列表数据</a>
	<div class="well">
		<!-- <button class="btn btn-primary ifrm" data-url="/index/addInput" data-width="720" data-height="650" data-title="录入信息" data-params="" style="float:right;padding:3px 6px">录入信息</button> -->
		<div class="btn-toolbar">
			<form>
				<input class="input input-medium" type="text" name="card_number" value="<?=I('get.card_number')?>" style="width: 80px;text-align: center" placeholder="卡券编号"/>
				<input class="input input-medium" type="text" name="user_name" value="<?=I('get.user_name')?>" style="width: 60px;margin-left:10px;text-align: center" placeholder="顾客名字"/>
				<input class="input input-medium" type="text" name="group_address" value="<?=I('get.group_address')?>" style="width: 60px;margin-left:10px;text-align: center" placeholder="组会地点"/>
				<!--<input readonly name="stime" class="input input-medium" onclick='WdatePicker({dateFmt:"yyyy-MM-dd"})' type="text" placeholder="组会时间-开始" value="<?=I('get.stime')?>" style="width:100px;margin-left:10px;text-align: center"/>&nbsp;-->
				<!--<input readonly style="margin-left:10px;width: 100px;text-align: center" name="etime" placeholder="组会时间-结束" class="input input-medium" onclick='WdatePicker({dateFmt:"yyyy-MM-dd"})' type="text" value="<?=I('get.etime')?>"/>-->
				<input readonly name="xq_stime" class="input input-medium" onclick='WdatePicker({dateFmt:"yyyy-MM-dd"})' type="text" placeholder="销券时间-开始" value="<?=I('get.xq_stime')?>" style="width:100px;margin-left:10px;text-align: center"/>&nbsp;
				<input readonly style="margin-left:10px;width:100px;text-align: center" name="xq_etime" placeholder="销券时间-结束" class="input input-medium" onclick='WdatePicker({dateFmt:"yyyy-MM-dd"})' type="text" value="<?=I('get.xq_etime')?>"/>
				<input type="hidden" value="<?=I('get.res')?>" name="res" />
				<button class="btn btn-info" style="margin:-9px 0 0 15px"><i class="icon-search"></i> 搜索</button>
			</form>
			<?php if(session('role_id') != 1){?>
			<!--<form id="addform" action="/index/input_csv1" method="post" enctype="multipart/form-data">-->
			<!--<p class="file">-->
			<!--请选择要导入的CSV文件：<br/>-->
			<!--<span>-->
			<!--<input type="file" name="file">-->
			<!--导入数据-->
			<!--</span>&lt;!&ndash;<input type="submit" class="btn" value="导入CSV">&ndash;&gt;-->
			<!--</p>-->
			<!--</form>-->
			<!--<a href="/index/custExportExcel?card_number=<?=I('get.card_number')?>&user_name=<?=I('get.user_name')?>&group_address=<?=I('get.group_address')?>&counselor=<?=I('get.counselor')?>&designer=<?=I('get.designer')?>&director=<?=I('get.director')?>&classroom=<?=I('get.classroom')?>&shopper=<?=I('get.shopper')?>&stime=<?=I('get.stime')?>&etime=<?=I('get.etime')?>"><button class="btn btn-primary" style="position:relative;float:right;padding:3px 6px;margin-right:0px;margin-top: -15px;">导出数据</button></a>-->
			<?php }?>
		</div>
		<hr>

		<table class="table">
			<thead>
			<tr>
				<th style="text-align:center;">卡券编号</th>
				<th style="text-align:center;">销券人</th>
				<th style="text-align:center;">顾客手机号</th>
				<th style="text-align:center;">顾客</th>
				<th style="text-align:center;">微雕机器操作人</th>
				<th style="text-align:center;">配药操作人</th>
				<th style="text-align:center;">注射操作人</th>
				<th style="text-align:center;">乐力果精华(瓶)</th>
				<th style="text-align:center;">操作套餐</th>
				<th style="text-align:center;">销券时间</th>
				<th style="text-align:center;">操作</th>
			</tr>
			</thead>
			<tbody>
			<?php if($getData){foreach($getData AS $key=>$val){ ?>
			<tr>
				<td style="text-align:center;vertical-align:middle;"><?=$val['card_number']?></td>
				<td style="text-align:center;vertical-align:middle;"><?=$val['input_name']?></td>
				<td style="text-align:center;vertical-align:middle;"><?=$val['user_mobile']?></td>
				<td style="text-align:center;vertical-align:middle;"><?=$val['user_name']?></td>
				<td style="text-align:center;vertical-align:middle;"><?=$val['machine_operator']?></td>
				<td style="text-align:center;vertical-align:middle;"><?=$val['dispens_operator']?></td>
				<td style="text-align:center;vertical-align:middle;"><?=$val['injection_operator']?></td>
				<td style="text-align:center;vertical-align:middle;"><?=$val['dosage']?></td>
				<td style="text-align:center;vertical-align:middle;"><?=$val['use_project']?></td>
				<td style="text-align:center;vertical-align:middle;"><?=date('Y-m-d H:i',$val['add_at'])?></td>

				<td style="text-align:center;vertical-align:middle;">
					<a class="ifrm btn btn-info" href="javascript:void(0)" data-url="/index/addInput" style="padding: 0px 4px;" data-width="720" data-height="650" data-title="修改信息" data-params="id/<?=$val['id']?>"><i class="icon-pencil"></i></a>&nbsp;&nbsp;
					<?php if(session('role_id') == 1 ){?>
					<a href="/index/delInput?id=<?=$val['id']?>" class="decate btn btn-danger" style="padding: 0px 4px;" role="button" title="删除信息" data-toggle="modal"><i class="icon-remove"></i></a>&nbsp;&nbsp;
					<?php }?>
				</td>
			</tr>
			<?php }}else{?>
			<tr><td style="text-align:center" colspan=18>暂无数据</td></tr>
			<?php }?>
			</tbody>
		</table>
		<span style="float:right;margin-top:-44px"><?=$page?></span>
	</div>
</div>
<script>
	$(function(){
		$('.decate').click(function(){
			if(!window.confirm('确认'+$(this).attr('title')+'吗 ?')){
				return false;
			}
			window.location = $(this).attr('href');
		});

		$('input[name=file]').change(function(){
			var formData = new FormData($( "#addform" )[0]);
			$.ajax({
				url: '/index/input_csv1',
				type: 'POST',
				dataType: 'json',
				contentType: false,
				processData: false,
				data: formData,
				success:function(d){
					if(d.code == 0){
						showmsg('导入成功',1);
						setTimeout(function(){window.location.href='/index/input?res=0-1';},2000);
					}else{
						showmsg(d.msg);
						return false;
					}
				}
			})
		})
	})
</script>